<div class="fsh-pop">
    <div id="add_form" class="layui-form">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i>*</i>开始时间</label>
            <div class="layui-input-block">
                <input lay-verify="required" placeholder="请输入内容" class="layui-input" id="startTime" readonly
                       name="start_time">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i>*</i>结束时间</label>
            <div class="layui-input-block">
                <input lay-verify="required" placeholder="请输入内容" class="layui-input" name="end_time" readonly
                       id="endTime">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i>*</i>是否在线</label>
            <div class="layui-input-block">
                <input type="hidden" id="isOnLine" name="is_on_line" value="0">
                <input type="checkbox" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
            </div>
        </div>
    </div>

</div>
<script type="text/javascript">
    layui.use(['table', 'laydate', 'form'], function () {
        var table = layui.table;
        var layDate = layui.laydate;
        var form = layui.form;

        $('#schoolId').val(userInfo.school_id);
        //开始日期
        layDate.render({
            elem: '#startTime'
            , type: 'datetime'
        });
        //结束日期
        layDate.render({
            elem: '#endTime'
            , type: 'datetime'
        });
        //是否在线
        form.on('switch(switchTest)', function (data) {
            $('#isOnLine').val(this.checked ? 1 : 0);
        });


    });


</script>
